LDLIBS = -lpthread
SRC = src
SOCKET = ${SRC}/sockets
CLIENT = ccli
SERVER = cserv
CLIENT_OBJ = ${SRC}/cloud_client.o ${SOCKET}/ClientSocket.o ${SOCKET}/Socket.o
SERVER_OBJ = ${SRC}/cloud_server.o ${SOCKET}/ServerSocket.o ${SOCKET}/Socket.o \
	   ${SRC}/Connection.o
CXXFLAGS = -g -Wall -pedantic

all: ${SERVER} ${CLIENT}

${SERVER}: ${SERVER_OBJ}
	g++ -o ${SERVER} ${CXXFLGAS} ${LDLIBS} ${SERVER_OBJ}

${CLIENT}: ${CLIENT_OBJ}
	g++ -o ${CLIENT} ${CXXFLAGS} ${LDLIBS} ${CLIENT_OBJ}

Socket: ${SOCKET}/Socket.h
SocketException: ${SOCKET}/SocketException.h
ServerSocket: ${SOCKET}/ServerSocket.h
ClientSocket: ${SOCKET}/ClientSocket.h
Connection:${SRC}/Connection.h
Constants:${SRC}/Constants.h

clean:  
	rm -rf ${SRC}/*.o ${SOCKET}/*.o ${SERVER} ${CLIENT}
